home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 015 / skprint.arc / PRINTER.DOC next >
Encoding:
Text File  |  1985-10-25  |  6.8 KB  |  148 lines

  1.  
  2. PRINTER.DOC file
  3. ----------------
  4.  
  5.  
  6. I have often wanted to access some of the different typestyles
  7. and line weights available from my printer, but have always found
  8. it far too cumbersome to exit my application, load BASIC, enter
  9. some realy cryptic codes into  a needlessly long program, run it,
  10. exit BASIC and return to  my application, only to have to go
  11. through the whole  exercise again in order to change back.
  12.  
  13. There are so many powerful features built into most printers, but
  14. it is so difficult to access them, it is no surprise few people
  15. bother.
  16.  
  17. Sure, there are a couple of public domain programs which allow
  18. selection of printer features from a menu, but none I  have seen
  19. yet run concurrently with your application, can be  accessed
  20. anywhere, anytime, and designed to suit your exact  needs.
  21.  
  22. Using Borland's Sidekick however, you can do just that.  If you
  23. also have their Superkey program, or a similar one the process of
  24. sending  a series of commands to the printer can be completely
  25. automated. This example shows how to do it, using an Epson  FX-
  26. 80, but the procedure should be applicable with most  printers.
  27.  
  28. The action happens inside a Sidekick notepad window, so open one
  29. up, and give it a name like PRINTER.MAT  I have set up a  matrix
  30. with five columns.  The first of these contains the  label or
  31. function to be activated, such as "Compressed",  "Pica", or
  32. "Elite", all of which are distinct pitches  available on the
  33. Epson.  Subsequent columns contain the  codes to activate the
  34. following variations:
  35. -    single strike (the printer's default)
  36. -    double strike
  37. -    single strike expanded (2x normal width)
  38. -    double strike expanded.
  39.  
  40. Each of these variations can be combined with the three pitches
  41. to give 12 different combinations, each with its own  access
  42. code.
  43.  
  44. I have also made room for special codes, such as Underlining
  45. mode, Italic mode, and 'script modes, which can be used with  any
  46. of the others.  Each of these has an activate and  deactivate
  47. code, in the second and third columns only  respectively.  I also
  48. recommend that you put in the Master  Reset Code, to get back to
  49. ordinary 10cpi Pica, should the  printer (or user!) get lost
  50. among all those possibilities.
  51.  
  52. Once the matrix has been set up, it is time to enter the codes
  53. themselves.  Here is where the first problem arises:   The Epson
  54. responds to codes which start with the "Esc"  character (ASCII
  55. 27).  But if you try to enter this  character into Sidekick, it
  56. drops you back into your  underlying application.
  57.  
  58. Fortunately, there are at least two simple and elegant solutions.
  59.  
  60. -   áTurn on the Notepad's graphics mode (Ctrl-Q-T, or whatever
  61.      you  have set up for yourself). The Epson and most other
  62.      printers also respond to the higher ASCII characters (128-
  63.      255), some  of which duplicate the lower ones that give the
  64.      Notepad such trouble.  For the "Esc" character, the FX-80
  65.      will accept  ASCII 155 (27+128).
  66.  
  67.      With graphics mode enabled, this character can be entered by
  68.      pressing the "Alt" key, and while holding it down, typing
  69.      "155" on the numerical keypad, then releasing the "Alt" key.
  70.      This needs to be done fairly quickly.  (With Superkey also
  71.      loaded, press "Alt" and "Left-Shift" together.)
  72.  
  73. -   áThe second alternative is to input ESC using a Control-Key
  74.      sequence.  The correct one is "caret-left sq.bracket", which
  75.      I cannot put into this file, since it would make it
  76.      difficult to print out on many printers. Look at # 27, in an
  77.      ASCII chart.
  78.  
  79. Then you can enter the relevant additional codes.  I have used
  80. the Epson Master Select system, which assigns each  combination
  81. to a unique number, prefaced with an "!".  So,  my command to
  82. turn on "Double-Strike-Expanded-Elite" is  "Escape-Exclamation
  83. Mark-1" (three characters only).  If a  code is one that Notepad
  84. has trouble with, simply enter the  +128 version, which means the
  85. same thing to the printer in  every case that matters.
  86.  
  87. An example is shown in PRINTER.MAT
  88.  
  89. Have this file loaded into Sidekick residing in the background.
  90. To send a code to the printer:
  91.  
  92.      -    activate Sidekick with "Ctrl-Alt",
  93.      -    move the cursor to the beginning of the code for
  94.                the desired feature,
  95.      -    press the "Begin-Block" command (F7),
  96.      -    move to the right, to the space past the last character,
  97.      -    press the "End-Block" command (F8),
  98.      -    press the "Block-Print" command (Ctrl-K-P), and
  99.      -    exit Sidekick with "Ctrl-Alt".
  100.  
  101. Block markers are inserted immediately before the character over
  102. the cursor, so be careful to enclose the whole string  inside
  103. these markers.  Block-Print sends this string to the  printer;
  104. since it's prefaced with an "Esc", the printer  interprets it as
  105. a feature select command.
  106.  
  107. An alternative for positioning the Block markers is to move over
  108. just to the first character of the string, and use the Sidekick
  109. "Mark Single Word" command.  This is useful where strings to go
  110. to the printer might be of varying lengths.  In my example, they
  111. are not, so I have used the first method.
  112.  
  113. Now for the fun part, the Superkey macros that make it so easy to
  114. send one of these codes to the printer.  Sure it can  be done
  115. manually by laboriously moving around the matrix,  but with a few
  116. keystrokes, you can set up four macros to do  it all.
  117.  
  118. My macros are assigned to Alt-1 through Alt-4, to represent
  119. columns one though four of codes (actually columns two  through
  120. five of the whole matrix.)  Each macro goes through  the
  121. procedure outlined above, with one change at the end.   After the
  122. "Block-Print" is issued, I use the command to  return to the
  123. beginning of each line, then press "F7" and  "F8" while
  124. positioned under the first character.  This  effectively cancels
  125. the block markers.
  126.  
  127. Using this setup, I don't need to waste time moving my cursor
  128. through the text, but need only scroll up or down in  column 1,
  129. to find the desired line.  Since there are no more  than 12 lines
  130. in the whole file, it all happens very  quickly.
  131.  
  132. If you use the first method of marking blocks, where each string
  133. must is the same length, and the macro jumps over a fixed number
  134. of spaces, be sure that empty spaces are padded out with the null
  135. character, ASCII 1, which can be represented by ASCII 128, as far
  136. as an Epson is concerned.
  137.  
  138. For printers with very complex and long command strings, like the
  139. HP Laserjet,  a matrix format might not work, and you should also
  140. use the "Mark SIngle Word" method of choosing a Block to send.
  141.  
  142. This technique works beautifully when you want to change print
  143. appearance on the fly, and can be set up in a few  minutes to
  144. exactly match your specific needs.
  145.  
  146. ----end
  147.  
  148.